import instance from '@/utils/axios.js'


function userLogin({mobile,code}) {
    return instance({
        url:'/v1_0/authorizations',
        method:'post',
        data:{mobile,code}
    })
}

export { userLogin }


import {getToken} from '@/utils/token'
// 获取个人信息
const getInfo = () => {
    return instance({
        url: '/v1_0/user/profile',
        method: 'get',
        headers:{authorization:`Bearer ${getToken()}`}
    })
}       

export { getInfo }

// 设置个人信息
const setInfo = (data) => {
    return instance({
        url: '/v1_0/user/profile',
        method: 'patch',
        data,
        headers:{authorization:`Bearer ${getToken()}`}
    })
}
export { setInfo }


// 修改头像
const setImg = fd  => {
    return instance({
        url: '/v1_0/user/photo',
        method: 'PATCH',
        data: fd,
        headers:{authorization:`Bearer ${getToken()}`}
    })
}

export {setImg}
